<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/30
 * Time: 14:27
 */
namespace app\Admin\controller;

use app\common\controller\AdminBase;
use think\Db;

class Index extends AdminBase{
    public function index(){
        $teachers = Db::name('users')->where(array('usertype' => 2))->order('id','desc')->paginate(10);
        $page = $teachers->render();
        $url      = 'http://' . $_SERVER['HTTP_HOST'] . '/template.xlsx';
        $this->assign('url', $url);
        $this->assign('page', $page);
        return $this->fetch('admin/index', array('admin_user_list' => $teachers));
    }
}